package com.pc.controller;

import com.pc.common.Result;
import com.pc.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/student")
public class StudentController {
    @Autowired
    IStudentService studentService;
    @GetMapping("/getStudent")
    public String getStudentName(){
        return studentService.getStudent();
    }

    @GetMapping("/getAllStudent")
    public Result getStudent(){
        return studentService.getAllStudent();
    }

    @GetMapping("findStudentById/{id}")
    public Result getStudentById(@PathVariable Long id){
        return studentService.getStudentById(id);
    }

}
